def main():
    hlimit,llimit = 999,100
    results = []
    for i in range(hlimit, llimit, -1):
        for j in range(i, llimit, -1):
            res = str(i * j)
            if res == res[::-1]:
                results.append(i*j)
    return max(results)
print main()
